// JavaScript Document
$("#submitForm").click(
 function() {	 
	var aItems = $('form');
		aItems.each(function() {
			var act = $(this).attr("action").split("?");
			var data = subpageFrame('textalrs');
			if (!isNaN(data)) {
					$(this).attr("action",act[0] + "?id=" + data);
			} else {
					if (GetQueryString("id") != null || !isNaN(GetQueryString("id"))) {
					   $(this).attr("action",act[0] + "?id=" + GetQueryString("id"));
					}
			}
			if (checkForm(this,'agreeNo|repayMethod|cooperative|loanType|city|purpose|fundRaisingTime|userBank|bankBranch|bankNumber|bankLocation|loanDescription')) {
				$("#submitForm").attr("disabled",true);
				$(this).submit();
				$("#textalrs").load(function(){
					$("#submitForm").attr("disabled",false);
			    }); 
			}
		});
});

function openButs(){
	var data = subpageFrame('textalrs');
	if (isNaN(data)) {
		if (GetQueryString("id") != null && !isNaN(GetQueryString("id"))) {
			var aItems = $(".leftBut");
			aItems.each(function() {
				   $(this).removeAttr("disabled");
			});
		}
	}
}
openButs();

var formItems = $('form');